//
//  UIViewControllerextension.swift
//  ShowDance
//
//  Created by 苏泊尔漫也要按时吃饭 on 2022/12/12.
//

import Foundation

extension UIViewController {
    
    //跳转某个vc
    func presentViewcontroller(className: AnyClass) {
        var lastVC = self.presentingViewController
        while((lastVC?.presentingViewController) != nil) {
            lastVC = lastVC?.presentingViewController
            if ((lastVC?.isKind(of: className)) != nil) {
                break
            }
        }
        lastVC?.modalPresentationStyle = .fullScreen
        lastVC?.dismiss(animated: true)
    }
}
